﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
        $(document).ready(function () {
            $("#autoRefreshedContainer").load('@Url.Action("servertime", "test")');

            //?randval=' + Math.random() : is used to ensure that the browser ignores the cached version
            //Replace '@Url.Action("servertime", "test")' with your own URL
            setInterval(function () {
                $("#autoRefreshedContainer").load('@Url.Action("servertime", "test")?randval=' + Math.random());
            }, 9000);
            $.ajaxSetup({ cache: false });
        });
    </script>
</head>
    <body>

     <h1>Server time (outo-refresh every 9 seconds): </h1>
     <div id="autoRefreshedContainer"></div>

    </body>
</html>